package com.qtt.app.mapper;

import com.qtt.app.entity.Comment;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CommentMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(Comment record);

    int insertSelective(Comment record);

    Comment selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Comment record);

    int updateByPrimaryKeyWithBLOBs(Comment record);

    int updateByPrimaryKey(Comment record);

    @Select("SELECT id FROM comment ORDER BY id DESC LIMIT 1")
    int getLastId();//查找最后添加的id，用于添加数据后返回id

    List<Comment> getCommentsByGeneralId(@Param("generalId") String generalId);
}